package cn.edu.baiyunu.myapplication.ui.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color

/**
 * 渐变背景组件，用于实现与原型图匹配的紫蓝色渐变背景
 */
@Composable
fun GradientBackground(
    modifier: Modifier = Modifier,
    startColor: Color = Color(0xFF6A11CB),
    endColor: Color = Color(0xFF2575FC),
    content: @Composable BoxScope.() -> Unit
) {
    val gradientBrush = Brush.linearGradient(
        colors = listOf(startColor, endColor)
    )
    
    Box(
        modifier = modifier
            .fillMaxSize()
            .background(brush = gradientBrush),
        content = content
    )
}

/**
 * 简化版渐变背景组件，不包含内容，只提供背景
 */
@Composable
fun GradientBackground(
    modifier: Modifier = Modifier,
    startColor: Color = Color(0xFF6A11CB),
    endColor: Color = Color(0xFF2575FC)
) {
    val gradientBrush = Brush.linearGradient(
        colors = listOf(startColor, endColor)
    )
    
    Box(
        modifier = modifier
            .fillMaxSize()
            .background(brush = gradientBrush)
    )
} 